package com.george.common.api.feign.user;

import com.george.common.api.feign.fallBack.user.UserServiceFeignFallBack;
import com.george.common.entity.dto.user.ScbUserDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * Create By George on /2023/4/10
 * description:
 *
 * @author George
 */
@FeignClient(name = "bucket-user", path = "/user", fallbackFactory = UserServiceFeignFallBack.class)
public interface UserServiceFeign {

    /**
     * 根据用户id获取用户信息
     *
     * @param userId
     * @return java.lang.String
     * @author George
     * @date 2023/4/10 1:18
     */
    @RequestMapping("/getUserInfoById/{userId}")
    ScbUserDTO getUserInfoById(@PathVariable("userId") Long userId);

    /**
     * 根据用户名称获取用户信息
     *
     * @param name
     * @return java.lang.String
     * @author George
     * @date 2023/4/10 1:18
     */
    @RequestMapping("/getUserInfoByName/{name}")
    ScbUserDTO getUserInfoByName(@PathVariable("name") String name);

    /**
     * 根据登录用户名称获取用户信息
     *
     * @param username
     * @return com.george.common.entity.dto.user.ScbUserDTO
     * @author George
     * @date 2023/7/11 17:37
     */
    @RequestMapping("/getUserInfoByUsername/{username}")
    ScbUserDTO getUserInfoByUsername(@PathVariable("username") String username);
}
